<?php

namespace app\modules\api\controllers;

use Yii;
use yii\web\Controller;
use common\models\Tools;
use common\models\Region;

/**
 * Default controller for the `api` module
 */
class RegionController extends Controller
{
    public $enableCsrfValidation = false;
    /**
     * Renders the index view for the module
     * @return string
     */
    public function actionGetSubRegion(){
        $region_id = Tools::GetSafeParam('region_id', 0, 0);
        $data = Region::getSubRegions($region_id);
        
        $output['success'] = 1;
        $output['msg'] = "获取成功";
        $output['data'] = $data;
        Tools::outputjson($output);
    }
}
